package edu.pku.sei.act.ctrl.command;

import edu.pku.sei.act.model.mote.Mote;
import edu.pku.sei.act.model.mote.OuterModelElement;
import edu.pku.sei.act.model.mote.SimpleDevice;
import edu.pku.sei.gmp.model.concept.GMPModelElement;

public class CreateSimpleDeviceCommand extends CreateBaseCommand{

	private Mote model;
	private SimpleDevice element;
	public CreateSimpleDeviceCommand(GMPModelElement parent,
			OuterModelElement element) {
		super(parent, element);
		// TODO Auto-generated constructor stub
	}
	public void execute() {
		if (model != null) {
			element.setContainer(model);
			model.setSimpleDevice(element);
		}
	}
	
	public void undo() {
		if (model != null) {
			model.setSimpleDevice(null);
		}
		element.setContainer(null);
	}

}
